<?php

/**
 * @file
 * Functionality for CSNA administration.
 */

/**
 * Menu callback: config varible.
 */
function variable_admin_settings() {

    $form['search_autocomplete'] = array(
        '#type' => 'fieldset',
        '#title' => '全文搜索参数配置(选择是否全文搜索)',
        '#description' => '',
    );
    $result = db_select('search_autocomplete_forms', 'f')
        ->fields('f')
        ->condition('enabled', 1, '=')
        ->execute()
        ->fetchAllAssoc('fid');
    // Build the setting array to transfer to JS.

    foreach ($result as $match) {
        if($match->enabled ==='1'&& !empty($match->data_static)){
            $form['search_autocomplete']['search_autocomplete'.$match->selector.'_inword'] = array(
                '#type' => 'checkbox',
                '#title' => $match->title,
                '#default_value' => variable_get('search_autocomplete'.$match->selector.'_inword', 0),
            );
        }

    }

    return system_settings_form($form);

}
